<!-- 网页加载 -->
<template>
  <view class="webview-container">
    <view class="nav-bar">
      <view class="back-btn" @tap="handleBack">
        <!-- <text class="iconfont icon-back"></text> -->
        <uni-icons type="left" size="25"></uni-icons>
      </view>
    </view>
    <web-view :src="url" />
  </view>
</template>

<script setup>
  import { onLoad } from '@dcloudio/uni-app';
  import { ref } from 'vue';

  const url = ref('');
  onLoad((options) => {
    url.value = decodeURIComponent(options.url);
  });

  const handleBack = () => {
    uni.navigateBack();
  };
</script>

<style lang="scss" scoped>
.webview-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 88rpx;
  background: #ffffff;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 30rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}

.back-btn {
  width: 60rpx;
  height: 60rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  
  .icon-back {
    font-size: 36rpx;
    color: #333333;
  }
}
</style>
